const http = require("http")
const os = require("os")

console.log("server starting ...")

var handler = function (req, resp) {
    console.log("received req from " + req.connection.remoteAddress);
    resp.writeHead(200);
    resp.end("you hit " + os.hostname() + "\n");
};

var www = http.createServer(handler)
www.listen(8080);